<?php
include('../../inc/global.inc');
$url=$_SERVER['HTTP_REFERER'];
?>
<?php
if($_POST[act_tj]){
$job_hy_id=($_POST[job_hy_id])?$_POST[job_hy_id]:0;
mysql_query("insert into job_hy  (job_hy_name,job_hy_id) values ('$_POST[job_hy_name]','$job_hy_id')");
echo "<script>location='".$_POST[url]."';</script>";
}
?>
<?php
if($_POST['act_xg']){
$job_hy_id=($_POST[job_hy_id])?$_POST[job_hy_id]:0;
mysql_query("update job_hy set job_hy_name='$_POST[job_hy_name]',job_hy_id='$job_hy_id' where id='".$_POST['iid']."'");
echo "<script>location='".$_POST[url]."';</script>";
}
?>
<HTML>
<HEAD>
<TITLE>Admin</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../css/css.css" rel=stylesheet>
<script type='text/javascript' src="../js/islogin.js" charset="utf-8"></script>
</HEAD>
<BODY>
<center>
  <table width="50%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <tr>
      <td height="25" bgcolor="#EEEEF9" style="padding-left:5px;">招聘行业分类&nbsp;&nbsp;<a href="javascript:history.go(-1)">返回</a></td>
    </tr>
  </table>
<?php
if($_GET[tj]){
?>
  <table width="50%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
  <form method="post" action="">
    <tr>
      <td height="30" colspan="2" align="center" bgcolor="#8DA8CF" style="padding-left:5px;">添加行业分类</td>
    </tr>
    <tr>
      <td width="30%" height="30" align="center" bgcolor="#FFFFFF"><span style="padding-left:5px;">行业名称</span> </td>
      <td width="70%" align="left" bgcolor="#FFFFFF" style="padding-left:2px;"><input name="job_hy_name" type="text" id="job_hy_name" size="18" maxlength="50"></td>
    </tr>
	 <tr>
      <td height="30" align="center" bgcolor="#FFFFFF">上级目录</td>
      <td align="left" bgcolor="#FFFFFF" style="padding-left:2px;"><select name="job_hy_id">
  <option value="0" selected>--选择上级目录--</option>
  <?php
  $sql="select * from job_hy where job_hy_id=0";
  $rs=mysql_query($sql);
  while($row=mysql_fetch_array($rs)){
  ?><option value="<?=$row['id']?>" <?php if($_GET[id]==$row['id']){echo "selected";}?>><?=$row[job_hy_name]?></option>
  <?php
  }?>
      </select></td>
    </tr>
    <tr>
	<input type="hidden" name="act_tj" value="ok"><input type="hidden" name="url" value="<?=$url?>">
      <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" value="提交"></td>
    </tr>
	</form>
  </table>
<?php }?>
<?php
if($_GET['xg']){
$sql="select * from job_hy where id=".$_GET['xg_id'];
$rs=mysql_query($sql);
$row=mysql_fetch_array($rs)
?>
<table width="50%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
    <form method="post" action="">
      <tr>
        <td height="30" colspan="2" align="center" bgcolor="#8DA8CF"><span style="padding-left:5px;">修改行业分类</span></td>
      </tr>
      <tr>
        <td width="30%" height="30" align="center" bgcolor="#FFFFFF"><span style="padding-left:5px;">行业名称</span></td>
        <td width="70%" align="left" bgcolor="#FFFFFF" style="padding-left:2px;"><input name="job_hy_name" type="text" value="<?=$row[job_hy_name]?>" size="18" maxlength="50"></td>
      </tr>
      <tr>
        <td height="30" align="center" bgcolor="#FFFFFF">上级目录</td>
        <td align="left" bgcolor="#FFFFFF" style="padding-left:2px;">
<select name="job_hy_id">
   <option value="0">--选择上级目录--</option>
  <?php
  $sql2="select * from job_hy where job_hy_id=0 order by id asc";
  $rs2=mysql_query($sql2);
  while($row2=mysql_fetch_array($rs2)){
  ?>
    <option value="<?=$row2['id']?>" <?php if($row2[id]==$row[job_hy_id]){echo "selected";}?>><?=$row2[job_hy_name]?></option>
 
 <?php
  }?>
        </select></td>
      </tr>
      <tr><input type="hidden" name="url" value="<?=$url?>">
        <input type="hidden" name="act_xg" value="ok"><input type="hidden" name="iid" value="<?=$row['id']?>">
        <td height="30" colspan="2" align="center" bgcolor="#FFFFFF"><input name="submit" type="submit" value="提交"></td>
      </tr>
    </form>
  </table>
  <?php
}?>
</center>
</BODY>
</HTML>
